/**
 * 通用框架封装
 * Copyright (c) 2019 itsoft
 */
import itsoftUIRouter from './router/index'
import itsoftUIConfig from './config/index'
import itsoftToken from './auth/token'
import './icons'
export default {
    install: function (Vue, Router) {
        console.log(itsoftUIRouter);
        // 初始化router
        itsoftUIRouter.init(Router)
        // 设置vue原型链
        Vue.prototype.$itsoftUI = {
            config: itsoftUIConfig,
            getToken()
            {
                return itsoftToken.getToken()
            },
            getTokenKey()
            {
                return itsoftToken.getTokenKey()
            },
            saveTokenKey(tokenKey) {
                return itsoftToken.saveTokenKey(tokenKey);
            },
            logout()
            {
                return itsoftToken.logout()
            },
            async getUserInfo() {
                return  itsoftToken.getUserInfo();
            },
            getTimestamp()
            {
                return itsoftToken.getTimestamp()
            }

        }
    }
}
